extends Card

func init():
	att.cry = 1
	lv = 4
	type = TYPE.MAGIC
	camp = "m_all" 
	name = "肃正协议" 
	dec = "骰出一个六面骰子，根据点数将对目标造成2倍伤害。" 
	aiTab = "back" 
	isUsable = false

func _use(card,cell):
	var q = sys.rndRan(1,6);
	if card != null :
		sys.scene.queueFunc(self,"eff",1.0,[card.getPos()])
		hurtCard(card,q*2)
		
func useSelIf(card,cell):
	if card != null && (card.type == TYPE.CREATURE || card.type == TYPE.HERO):
		return true
	return false	
			
func eff(pos):
	var eff = sys.scene.newEff("e_feiDang")
	eff.play("fei",false)
	eff.position = getPos()
	eff.lookAt(pos)
	eff.MoveTo(pos,2000,false)
	yield(eff,"onMoveEnd")
	sys.scene.funcTime = 0.0
	eff.lookAt()
	eff.play("bao")